"""
掉头发！！！
"""

import requests
import re

#1、首先找到reload函数执行位置
# var _0x23a392 = arg1[_0x55f3('0x19', '\x50\x67\x35\x34')]();
# arg2 = _0x23a392[_0x55f3('0x1b', '\x7a\x35\x4f\x26')](_0x5e8b26);
#2、多次运行发现_0x5e8b26值固定不变3000176000856006061501533003690027800375,需要破解_0x23a392,即unsbox




def hexXor():
    pass

"""
function() {
                var _0x4b082b = [0xf, 0x23, 0x1d, 0x18, 0x21, 0x10, 0x1, 0x26, 0xa, 0x9, 0x13, 0x1f, 0x28, 0x1b, 0x16, 0x17, 0x19, 0xd, 0x6, 0xb, 0x27, 0x12, 0x14, 0x8, 0xe, 0x15, 0x20, 0x1a, 0x2, 0x1e, 0x7, 0x4, 0x11, 0x5, 0x3, 0x1c, 0x22, 0x25, 0xc, 0x24];
                var _0x4da0dc = [];
                var _0x12605e = '';
                for (var _0x20a7bf = 0x0; _0x20a7bf < this['\x6c\x65\x6e\x67\x74\x68']; _0x20a7bf++) {
                    var _0x385ee3 = this[_0x20a7bf];
                    for (var _0x217721 = 0x0; _0x217721 < _0x4b082b[_0x55f3('0x16', '\x61\x48\x2a\x4e')]; _0x217721++) {
                        if (_0x4b082b[_0x217721] == _0x20a7bf + 0x1) {
                            _0x4da0dc[_0x217721] = _0x385ee3;
                        }
                    }
                }
                _0x12605e = _0x4da0dc['\x6a\x6f\x69\x6e']('');
                return _0x12605e;
            };
"""
def unsbox(arg1):
    _0x4b082b = [0xf, 0x23, 0x1d, 0x18, 0x21, 0x10, 0x1, 0x26, 0xa, 0x9, 0x13, 0x1f, 0x28, 0x1b, 0x16, 0x17, 0x19, 0xd,
                 0x6, 0xb, 0x27, 0x12, 0x14, 0x8, 0xe, 0x15, 0x20, 0x1a, 0x2, 0x1e, 0x7, 0x4, 0x11, 0x5, 0x3, 0x1c,
                 0x22, 0x25, 0xc, 0x24]
    _0x4da0dc = []
    _0x12605e = ''
    for _0x20a7bf in range(0, len(arg1)):
        _0x385ee3 = arg1[_0x20a7bf]
        for _0x217721 in range(0,len(_0x4b082b)):
            if _0x4b082b[_0x217721] == _0x20a7bf + 1:
                # _0x4da0dc[_0x217721] = _0x385ee3
                _0x4da0dc.append(_0x385ee3)
    _0x12605e = "".join(_0x4da0dc)
    return _0x12605e


header = {
            'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36',
        }
index_response = requests.get(url="https://bbs.nubia.cn/",headers=header)
arg1_search = re.compile(r"arg1='(.*?)';")
arg1 = arg1_search.search(index_response.text).group(1)
